﻿<%@ Page Language="C#" MasterPageFile="~/Administrator/Admin.master" AutoEventWireup="true"
    Inherits="Administrator_AdminNewsCategorys" Title="Quản trị Danh Mục Tin Tức"
    CodeBehind="AdminNewsCategorys.aspx.cs" %>

<%@ Register Src="~/Administrator/Controls/PaggingControl.ascx" TagName="PaggingControl"
    TagPrefix="EHT" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h1>
        <asp:Label ID="lbAdminCategory" runat="server" Text="Danh sách Danh Mục Tin Tức"></asp:Label>
    </h1>  
     <p class="submitButton">
        <asp:Button ID="btnAdd" runat="server" Text="Thêm mới danh mục tin tức" OnClick="btnAdd_Click" CssClass="btn_action" />
    </p>
    <p style="padding-left:26%; color:Red" >
        <asp:Literal ID="ltrMessage" runat="server"></asp:Literal> 
    </p> 
   <table cellspacing="0" cellpadding="0" class="data-table"  >
    <tr>
        <td style="width:25%" valign="top">
            <asp:TreeView ID="tvNhomTinTuc" runat="server" 
                onselectednodechanged="tvNhomTinTuc_SelectedNodeChanged" ShowLines="True" 
                Width="200px" >
            </asp:TreeView>
        </td>
        <td style="width:75%" valign="top">
             <asp:Repeater ID="rpDanhMucTinTuc" runat="server" 
                 onitemcommand="rpDanhMucTinTuc_ItemCommand" >
        <HeaderTemplate>
            <table cellspacing="0" cellpadding="0" class="data-table">
                <thead>
                    <tr>
                        <th  align="center">
                            STT
                        </th>
                        <th class="actions edit" align="center">
                            Sửa
                        </th>
                        <th class="actions delete" align="center">
                            Xóa
                        </th>
                        <th align="center">
                            Tên danh mục (VN)
                        </th>
                        <th class="OtherLanguage" align="center">
                            Tên danh mục (Other)
                        </th>
                        <th  align="center" style="width:40px">
                            Icon
                        </th>
                         <th align="center" style="width:60px">
                            Thứ tự
                            <asp:ImageButton ID="ibtnSaveAll" ImageUrl="Templates/Images/save_all.jpg" Height="20"
                                Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                CommandName="save_all" />
                        </th>
                         <th align="center" style="width:60px">
                            Trạng thái
                        </th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td style="width:10px">
                    <%#Eval("IndexId")%>
                </td>
                <td class="actions edit">
                    <a href='AdminNewsCategoryIU.aspx?DanhMucTinTucID=<%#Eval("DanhMucTinTucID")%>'>
                        <img alt="Edit" src="Templates/Images/Edit.png"></a>
                        <asp:Literal ID="ltrDanhMucTinTucID" runat="server" Visible="false" Text='<%#Eval("DanhMucTinTucID")%>'></asp:Literal>
                </td>
                <td class="actions delete">
                    <a href='#'>
                        <asp:ImageButton ID="btnDelete" ToolTip="Delete" CommandArgument='<%#Eval("DanhMucTinTucID")%>'
                            CommandName="delete1" runat="server" ImageUrl="Templates/Images/Delete.png" OnClientClick="return confirm('Bạn có muốn xóa danh mục tin tức này không ?');  " />
                </td>
                <th>
                    <%#Eval("TenDanhMucTinTucVN") %>
                </th>
                <th class="OtherLanguage">
                    <%#Eval("TenDanhMucTinTucOther") %>
                </th>
                <td>
                    <asp:Image ID="ImagIcon" Width="30px" runat="server" ImageUrl='<%#Eval("Icon")%>'/>
                </td>
                <td>
                     <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("SapXep")%>'></asp:TextBox>
                    <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                        CommandArgument='<%#Eval("DanhMucTinTucID") %>' ImageUrl="Templates/Images/save.jpg"
                        runat="server" />
                </td>               
                <td align="center">
                    <asp:CheckBox ID="ckPublish" runat="server" Checked='<%#Eval("Trangthai")%>' Visible="false" />
                    <asp:ImageButton Width="16" Height="16" ID="btnPublish" CommandName="publish" CommandArgument='<%#Eval("DanhMucTinTucID") %>'
                        ImageUrl="Templates/Images/btncheck.png" runat="server" />
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody> </table>
        </FooterTemplate>
    </asp:Repeater>
    <p>
        <EHT:PaggingControl ID="PaggingControl1" runat="server" PageURL="AdminNewsCategorys.aspx"
            PageSize="20" />
    </p>
        </td>
    </tr>
   </table>
   
</asp:Content>
